package com.onehouse.trigger.http;

import com.onehouse.domain.room.service.RoomTypeService;
import com.onehouse.types.constants.AjaxResult;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin("*")
@RequestMapping("/room-type")
public class RoomTypeController {

    @Autowired
    private RoomTypeService roomTypeService;

    @Operation(summary = "列出所有房间类型")
    @GetMapping("/list")
    public AjaxResult listAll() {
        return AjaxResult.success(roomTypeService.listAll());
    }

}
